// 封装关于departments的接口
import instance from "@/utils/request";

// 组织架构数据
export function getDepartmentsApi() {
    return instance({
        url: '/company/department'
    })
}

// 删除组织架构
export function deleteDepartmentsApi(id) {
    return instance({
        url: `/company/department/${id}`,
        method: 'delete'
    })
}

// 新增部门
export function addDeptsApi(data) {
    return instance({
        url: '/company/department',
        method: 'post',
        data
    })
}

// 获取指定部门信息
export function getDeptsByIdApi(id) {
    return instance({
        url: `/company/department/${id}`,
        method: 'get'
    })
}

// 编辑部门
export function editDeptsApi(data) {
    return instance({
        url: `/company/department/${data.id}`,
        method: 'put',
        data
    })
}